<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

Class Calon_siswa  extends CI_Controller{
    
    function __construct()
	{
	    parent::__construct();
		
	    $this->load->database();
	    $this->load->helper('url');		
	    $this->load->library('grocery_CRUD');	
        }
    function _example_output($output = null)
	{
            $this->load->view('dashboard',$output);
	}
        
    function index()
	{
		$this->_example_output((object)array('output' => '' , 'js_files' => array() , 'css_files' => array()));
	}
    
    function siswa()
    {
        $crud = new grocery_CRUD();
            $crud->set_table('t_calon_siswa');
            $crud->set_subject('Calon Siswa');
            $crud->columns('NO_CALSIS','KD_TAHUN_AJARAN','NM_SISWA','NM_PANGGILAN','KD_JENIS_KELAMIN','KD_GOL_DARAH','KD_AGAMA','ALAMAT','NO_TELP','ASAL_SMP','TANGGAL_STL_SMP','NO_STL_SMP','LAMA_BELAJAR','HUBUNGI','NILAI','DAFTAR_ULANG','USERNAME','TANGGAL_AKSES');
            $crud->set_relation('KD_TAHUN_AJARAN','r_tahun_ajaran','NM_TAHUN_AJARAN');
            $crud->set_relation('KD_GOL_DARAH','r_gol_darah','NM_GOL_DARAH');
            $crud->set_relation('KD_AGAMA','r_agama','NM_AGAMA');
            $crud->set_relation('ASAL_SMP','r_asal_sekolah','NM_SEKOLAH');
            $crud->set_relation('USERNAME','_auth','USERNAME');
            $crud->display_as('NO_CALSIS','No Calsis');
            $crud->display_as('KD_TAHUN_AJARAN','Tahun Ajaran');
            $crud->display_as('NM_SISWA','Nama Siswa');
            $crud->display_as('NM_PANGGILAN','Nama Panggilan');
            $crud->display_as('KD_JENIS_KELAMIN','Jenis Kelamin');
            $crud->display_as('KD_GOL_DARAH','Golongan Darah');
            $crud->display_as('KD_AGAMA','Agama');
            $output = $crud->render();
            $this->_example_output($output);
    }
    
    function nilai()
    {
        $crud = new grocery_CRUD();
        $crud->set_table('t_calon_siswa_nilai');
            $crud->columns('KD_MATPEL_BEFORE','NO_CALSIS','NILAI','USERNAME','TANGGAL_AKSES');
            $crud->set_subject('Nilai Calon Siswa');
            $crud->set_relation('NO_CALSIS','t_calon_siswa','NO_CALSIS');
            $crud->set_relation('KD_MATPEL_BEFORE','r_matpel_before','NM_MATPEL_BEFORE');
            $crud->set_relation('USERNAME','_auth','USERNAME');
            $crud->display_as('KD_MATPEL_BEFORE','Mata Pelajaran')
            $crud->display_as('NO_CALSIS','No calsis');
            $output = $crud->render();
            $this->_example_output($output);
    }
    
    function orangtua()
    {
        $crud = new grocery_CRUD();
        $crud->set_table('t_calon_siswa_orang');
            $crud->columns('NO_CALSIS','KD_JENIS_ORTU','KD_JENIS_KELAMIN','NM_ORTU','ALAMAT','NO_TELP','NO_HP','STATUS_HIDUP','TAHUN_MENINGGAL','USERNAME','TANGGAL_AKSES');
            $crud->set_subject('orang Tua Calon Siswa');
            $crud->set_relation('NO_CALSIS','t_calon_siswa','NO_CALSIS');
            $crud->set_relation('KD_JENIS_ORTU','r_jenis_ortu','NM_JENIS_ORTU');
            $crud->set_relation('USERNAME','_auth','USERNAME');
            $crud->display_as('KD_JENIS_ORTU','Orang Tua')
            $crud->display_as('NO_CALSIS','No calsis');
            $crud->display_as('KD_JENIS_KELAMIN','Jenis Kelamin');
            $crud->display_as('NM_ORTU','Nama Orang Tua');
            $output = $crud->render();
            $this->_example_output($output);
    }
    function riwayat penyakit()
    $crud = new grocery_CRUD();
        $crud->set_table('t_calon_siswa_rwyt_sakit');
            $crud->columns('NO_CALSIS','NO_URUT','ID_PENYAKIT','TAHUN_SAKIT','LAMA SAKIT','KETERANGAN','USERNAME','TANGGAL_AKSES');
            $crud->set_subject('riwayat penyakit');
            $crud->set_relation('NO_CALSIS','t_calon_siswa','NO_CALSIS');
            $crud->set_relation('ID_PENYAKIT','r_penyakit','NM_PENYAKIT');
            $crud->set_relation('USERNAME','_auth','USERNAME');
            $crud->display_as('KD_JENIS_ORTU','Orang Tua')
            $crud->display_as('NO_CALSIS','No calsis');
            $crud->display_as('KD_JENIS_KELAMIN','Jenis Kelamin');
            $crud->display_as('NM_ORTU','Nama Orang Tua');
            $output = $crud->render();
            $this->_example_output($output);
    }
}